package com.ruoyi.season.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.season.domain.PlaySeasonTaskRecord;
import com.ruoyi.season.mapper.PlaySeasonTaskRecordMapper;
import com.ruoyi.season.service.IPlaySeasonTaskRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 赛季任务记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-14
 */
@Service
public class PlaySeasonTaskRecordServiceImpl extends ServiceImpl<PlaySeasonTaskRecordMapper,PlaySeasonTaskRecord> implements IPlaySeasonTaskRecordService
{
    @Autowired
    private PlaySeasonTaskRecordMapper playSeasonTaskRecordMapper;

    /**
     * 查询赛季任务记录
     *
     * @param id 赛季任务记录主键
     * @return 赛季任务记录
     */
    @Override
    public PlaySeasonTaskRecord selectPlaySeasonTaskRecordById(String id)
    {
        return playSeasonTaskRecordMapper.selectPlaySeasonTaskRecordById(id);
    }

    /**
     * 查询赛季任务记录列表
     *
     * @param playSeasonTaskRecord 赛季任务记录
     * @return 赛季任务记录
     */
    @Override
    public List<PlaySeasonTaskRecord> selectPlaySeasonTaskRecordList(PlaySeasonTaskRecord playSeasonTaskRecord)
    {
        return playSeasonTaskRecordMapper.selectPlaySeasonTaskRecordList(playSeasonTaskRecord);
    }

    /**
     * 新增赛季任务记录
     *
     * @param playSeasonTaskRecord 赛季任务记录
     * @return 结果
     */
    @Override
    public int insertPlaySeasonTaskRecord(PlaySeasonTaskRecord playSeasonTaskRecord)
    {
        playSeasonTaskRecord.setCreateTime(DateUtils.getNowDate());
        return playSeasonTaskRecordMapper.insertPlaySeasonTaskRecord(playSeasonTaskRecord);
    }

    /**
     * 修改赛季任务记录
     *
     * @param playSeasonTaskRecord 赛季任务记录
     * @return 结果
     */
    @Override
    public int updatePlaySeasonTaskRecord(PlaySeasonTaskRecord playSeasonTaskRecord)
    {
        return playSeasonTaskRecordMapper.updatePlaySeasonTaskRecord(playSeasonTaskRecord);
    }

    /**
     * 批量删除赛季任务记录
     *
     * @param ids 需要删除的赛季任务记录主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonTaskRecordByIds(String[] ids)
    {
        return playSeasonTaskRecordMapper.deletePlaySeasonTaskRecordByIds(ids);
    }

    /**
     * 删除赛季任务记录信息
     *
     * @param id 赛季任务记录主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonTaskRecordById(String id)
    {
        return playSeasonTaskRecordMapper.deletePlaySeasonTaskRecordById(id);
    }

    @Override
    public Integer selectRecordCounts(String loginUserId, String playSeasonRecord, String taskId) {
        return baseMapper.selectRecordCounts(loginUserId, playSeasonRecord, taskId);
    }
}
